<?php

namespace app\api\model;

use think\exception\PDOException;
use think\Model;

class UserModel extends Model
{
    protected $name = "iuser";
    protected $autoWriteTimestamp=true;
    protected $updateTime='add_time';

    /**
     * 查询用户表里的openid
     */
    public function getOpenId($openid)
    {
        return $this->where('openid',$openid)->find();
    }
    
    /**
     * 更新用户信息 将用户信息存入到数据表中
     */
    public function updateUserInfo($param,$uid)
    {
        $this->where('id',$uid)->update($param);
        $userInfo = $this->where('id',$uid)->find();
        return msg(1,$userInfo,'添加用户信息成功');
    }

}
